import request from '@/router/axios';

// 获取列表
export const getFsTopicInfo = (displayType,current, size, params) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      displayType
    }
  })
}
// 生成展示材料
export const generate = (displayType,ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/generate',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo,
      displayType
    }
  })
}

// 详情
export const detail = (displayType,ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/detail',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo,
      displayType
    }
  })
}

// 逻辑删除
export const remove = (displayType,ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/remove',
    method: 'post',
    params: {
      ctopicNo,
      ftopicNo,
      displayType
    }
  })
}


// 专业组列表
export const getProGroupNoList = () => {
  return request({
    url: '/api/blade-purchase/materialgroupinfo/proGroupNoList',
    method: 'get'
  })
}

// 获取物料组
export const getMaterialGroupNoList = () => {
  return request({
    url: '/api/blade-purchase/materialgroupinfo/materialGroupNoList',
    method: 'get',
    params: {}
  })
}

export const updateTask = (data) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/updateTask',
    method: 'post',
    data
  })
}
// 更新展示材料标题信息
export const updateTitle = (data) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/updateTitle',
    method: 'post',
    data
  })
}

// 上传附件
export const uploadDisplayMaterialAttach = (data) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/uploadDisplayMaterialAttach',
    method: 'post',
    data
  })
}

// 附件详情
export const getFileList = (displayType,ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/displayMaterialAttachDetail',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo,
      displayType
    }
  })
}

// 更新展示材料物料组工艺图片信息
export const updatePhoto = (data) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/updatePhoto',
    method: 'post',
    data
  })
}

// 提交/取消提交展示材料
export const updateDisplayMaterialState = (displayType,ctopicNo,ftopicNo,state) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/updateDisplayMaterialState',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo,
      state,
      displayType
    }
  })
}
// 同步展示材料
export const syncDisplay = (displayType,ctopicNo,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/Synchronize',
    method: 'get',
    params: {
      ctopicNo,
      ftopicNo,
      displayType
    }
  })
}

// 更新展示材料时间进度和项目进度信息
export const updateSchedule = (data) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/updateSchedule',
    method: 'post',
    data
  })
}

// 上会历程
export const meetingHistory = (displayType,ftopicNo) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/meetingHistory',
    method: 'get',
    params: {
      ftopicNo,
      displayType
    }
  })
}

// lastcall展示材料列表
export const lastcallList = (current, size, params) => {
  return request({
    url: '/api/blade-purchase/displaymaterial/lastcallList',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}